function Father (name) {
  this.name = name
  this.aihao = ['爬山','游泳','电影','旅游']
}

Father.prototype.sayName = function () {
  console.log(this.name)
}

function Son (name, age) {
  Father.call(this, name)
  this.age = age
}


function interface (father,son){
  let clone = Object.create(father.prototype)
  clone.constructor = son
  son.prototype =  clone
}

interface(Father, Son)

Son.prototype.sayAge = function () {
  console.log(`${this.name}的年龄是${this.age}岁`)
}

Son.prototype.sayAihao = function () {
  console.log(this.aihao)
}
let mySon = new Son('lucy',20)

mySon.sayName()
mySon.sayAge()


mySon.sayAihao()

mySon.aihao.push('篮球')

mySon.sayAihao()